package jaxb.metagrammar;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import metagrammar.Operator;
import metagrammar.Operator.Instance;

public class OperatorInstanceAdapter extends XmlAdapter<AdaptedOperatorInstance, Operator.Instance> {
    
    @Override
    public Instance unmarshal(AdaptedOperatorInstance v) throws Exception
    {
        return v.getOperator().getInstance(v.getInputTuple());
    }
    
    @Override
    public AdaptedOperatorInstance marshal(Instance v) throws Exception
    {
        return new AdaptedOperatorInstance(v);
    }
    
}
